﻿@{
    ViewBag.Title = "网上咨询(Q&A)";
    var info = TempData["Info"];
    var hiddenInfo = "";
    if (info != null)
    {
        hiddenInfo = info.ToString();
    }
}
<div class="mainContentWithBorderNoPadding">
    <input type="hidden" id="hiddenInfo" value="@hiddenInfo"/>
    <div class="divQALeft">
        <p class="qaHeader">历史咨询解答</p>
        <div class="searchDiv">
            <form class="form-inline">
                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon" style="background-color: white;"><span class="glyphicon glyphicon-search"></span></div>
                        <input id="txtKeyWord" type="text" placeholder="请输入关键字搜索" class="form-control" />
                        <button type="button" id="btnSearch" class="btn btn-danger">
                            搜索
                        </button>
                    </div>
                </div>
            </form>
        </div>
        <div class="divQAContent" id="divQAContent">
        </div>
        <div id="pp" class="pagination"></div>
    </div>
    <div class="divQARight">
        @using (Html.BeginForm("AddQuestion", "QA", FormMethod.Post, new { id = "QAAddForm" }))
        {
            <h5>欢迎反馈问题，我们会尽快处理并给您答复</h5>
            <p><span class="info">*</span>遇到的问题描述</p>
            <textarea class="content" name="content" id="content" placeholder="详细描述您遇到的问题,有助于我们快速分析并定位原因，帮您解决问题，比如：1.具体遇到什么问题？ 2.问题出现前您做过什么操作？">
        </textarea><br />
            <br />
            <span class="spanContact">联系方式:</span><input type="text" name="contactWay" id="contactWay" placeholder="QQ/邮箱" /><span class="infoGray">我们将尽快联系你</span>
            <br />
            <br />
            <p>
                <button type="button" class="btn btn-danger btn-lg btn-block" id="btnSubmitQA">@Html.L("TxtSumit")</button>
            </p>
        }
    </div>
    <div class="clear"></div>
</div>
<script id="QA-template" type="text/x-handlebars-template">
    {{#each qas}}
       <div class="qaItem">
           <div class="qaItemHeader">
               <p>
                   <span class="qaIndex">{{@@index}}</span>
                   <span class="qaTitle">{{QuestionContent}}
                   </span>
               </p>
               <p class="qaFooter">
                   <span>提交：</span>
                   <span class="submitUser">{{UserName}}</span>
                   <span class="submitTime">{{CreateDate}}</span>
               </p>
           </div>
           <div class="qaItemContent">
               <div class="divAnsert">
                   {{AnswerContent}}
               </div>
               <p class="qaFooter">
                   <span>回答：</span>
                   <span class="submitUser">{{AnswerName}}</span>
                   <span class="submitTime">{{AnswerTime}}</span>
               </p>
           </div>
       </div>
    {{/each}}
</script>

@section scripts
{
    @Scripts.Render("~/bundles/JSTmp")
    @Scripts.Render("~/bundles/Page")
    @Scripts.Render("~/bundles/QA")
}